package com.fancymusic.service.impl;

import com.fancymusic.dao.ISingerDao;
import com.fancymusic.entity.Singer;
import com.fancymusic.service.ISingerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class SingerServiceImpl implements ISingerService {
    @Autowired
    ISingerDao iSingerDao;


    @Override
    public List<Singer> getSingerByname(Singer singer) {
        System.out.println("ISingerService===getSingerByname==="+singer);

        String singerName = singer.getSingerName();

        List<Singer> singerByName = iSingerDao.findSingerByName(singerName);
        System.out.println("ISingerService===getSingerByname==="+singerByName);

        return singerByName;
    }

    @Override
    public List<Singer> getSingerList() {
        List<Singer> singerList = iSingerDao.getSingerList();
        System.out.println("===SingerServiceImpl===getSingerList==="+singerList);
        return singerList;
    }

    @Override
    public void saveSinger(Singer singer) {
        iSingerDao.saveSinger(singer);
    }

    @Override
    public List<Singer> findSingerDynamic(Map map) {
        return iSingerDao.findSingerDynamic(map);
    }

    @Override
    public Singer findSingerBysid(Integer sid) {
        return iSingerDao.findSingerBysid(sid);
    }

    @Override
    public List<String> getAllRegin() {
        return iSingerDao.getAllRegin();
    }
}
